﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


using ClassCommon;
using ClassModel;
using ClassBLL;

namespace ClassWeb.App_Data
{
    public class BaseController : Controller
    {
        /// <summary>
        /// 当前登录用户
        /// </summary>
        // public t_classDemo_UserInfo currentUser;

        public BaseController()
        {


        }

        // private t_classDemo_UserInfo _currentUser;
        public t_classDemo_UserInfo CurrentUser
        {
            get
            {
                //if (_currentUser == null)
                //{
                int userId = HttpCookieHelper.GetUserID();
                if (userId != -1)
                {
                    return t_classDemo_UserInfo_BLL.GetUserInfoById(userId);
                }

                // return _currentUser;
                //}

                return null;
            }

        }


        public bool isLogin
        {
            get
            {
                return HttpCookieHelper.GetUserID() > 0;
            }
        }



    }
}
